﻿using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace Chart.Net
{
    public static class Utility
    {
        static Regex regex = new Regex(@"%(\d+)%");
        public static string ReadTemplate(string name)
        {
            string template = File.ReadAllText(name, Encoding.UTF8);
            template = template.Replace("{", "{{").Replace("}", "}}");
            template = regex.Replace(template, "{$1}");
            return template;
        }
    }
}
